﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using POSSystem.DAL;

namespace POSSystem.BLL
{
    public class View_CustomerOrders : _View_CustomerOrders
    {
        public static View_CustomerOrders GetCustomerOrderByCustID(int id)
        {
            View_CustomerOrders cust = new View_CustomerOrders();
            cust.Where.CustomerID.Value = id;
            cust.Query.Load();

            return cust;
        }

        public static View_CustomerOrders GetNotTemporaryCustomerOrderByCustID(int id)
        {
            View_CustomerOrders cust = new View_CustomerOrders();
            cust.Where.CustomerID.Value = id;
            cust.Where.StatusID.Value = OrderStatus.Temporary;
            cust.Where.StatusID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.NotEqual;
            cust.Query.Load();

            return cust;
        }

        public static View_CustomerOrders GetCustomerOrderByID(int id)
        {
            View_CustomerOrders cust = new View_CustomerOrders();
            cust.Where.ID.Value = id;
            cust.Query.Load();

            return cust;
        }
    }
}
